package com.study.demo.controller;

import com.study.demo.annotation.UserLoginToken;
import com.study.demo.dao.UserRepository;
import com.study.demo.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created on 2019/9/19.
 *
 * @author Grak
 * @since 1.0
 */
@RestController
public class UserController {

    @Autowired
    UserRepository userRepository;

    @UserLoginToken
    @GetMapping("/getAll")
    public List<User> findUserAll(){
        return userRepository.findAll();
    }
}
